<!DOCTYPE HTML>
<html dir="ltr" xml:lang="en-US" lang="en-US">
<head>
<meta charset="utf-8">
<script>
  var _console = {
    foo: "bar"
  }

  window.console = _console;

  function loadIFrame() {
    var iframe = document.body.querySelector("iframe");
    iframe.addEventListener("load", function() {
      iframe.removeEventListener("load", arguments.callee, true);
    }, true);

    iframe.setAttribute("src", "test-console.html");
  }
</script>
</head>
<body>
  <iframe></iframe>
</body>
